<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			var now = new Date();//打印当前时间
			console.log(now);	
			
			var now1 = new Date("2015/8/18 12:12:12"); //输入时间
			console.log(now1);	
			
			var year = now1.getFullYear();  //获取年份
			console.log(year);	 
			
			var month = now1.getMonth();  //获取月份
			console.log(month+1);	  //月份+1，真实的月份
			
			var day = now1.getDate(); //获取天数
			console.log(day);
			
			console.log(now1.toLocaleDateString());// 2018/8/18 获取中国格式日期
			
			console.log(now1.toLocaleTimeString());// 上午12:12:12 获取中国格式时间
			
//			eval去掉双引号
			console.log(eval("4+7")); eval去掉双引号
		</script>
	</head>
	<body>
	</body>
</html>
